﻿<UserControl x:Class="WorkflowApplicationControls.WorkflowTree"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>
        <HierarchicalDataTemplate x:Key="ParentActivityTemplate" ItemsSource="{Binding Path=Children}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="21.5"/>
                    <ColumnDefinition Width="*" MinWidth="26.098"/>
                </Grid.ColumnDefinitions>
                <Image Grid.ColumnSpan="1" Width="16" HorizontalAlignment="Center" VerticalAlignment="Center" Height="16">
                    <Image.Source>
                        <Binding Path="ItemIcon"/>
                    </Image.Source>
                </Image>
                <TextBlock Grid.Column="1" Margin="1,0,0,0" Text="{Binding Path=Label}"/>
            </Grid>
        </HierarchicalDataTemplate>
    </UserControl.Resources>

    <Grid HorizontalAlignment="Stretch">
        <TreeView HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Background="{x:Null}" BorderBrush="{x:Null}"
                  x:Name="workflowTreeview" SelectedItemChanged="OnSelectedItemChanged" 
                  ItemTemplate="{StaticResource ParentActivityTemplate}" ItemContainerStyle="{DynamicResource TreeViewItemStyle}"
                  ItemsSource="{Binding Path=LeftPaneItems}"/>
    </Grid>
</UserControl>
